home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16657 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: Starbase.NeoSoft.COM!not-for-mail
  2. From: timd@Starbase.NeoSoft.COM (Tim Dugan)
  3. Newsgroups: comp.object,comp.lang.c++,comp.realtime,comp.dcom.telecom.tech,comp.arch.embedded
  4. Subject: Re: Can OO be successful in real-time embedded systems?
  5. Date: 11 Apr 1996 12:34:41 -0500
  6. Organization: NeoSoft, Inc. +1 713 968 5800
  7. Message-ID: <4kjfrh$28g@Starbase.NeoSoft.COM>
  8. References: <316BF0C5.1FE1@condat.de> <RMARTIN.96Apr11113222@rcm.oma.com>
  9. NNTP-Posting-Host: starbase.neosoft.com
  10.  
  11. In article <RMARTIN.96Apr11113222@rcm.oma.com>,
  12. Robert C. Martin <rmartin@oma.com> wrote:
  13. >In article <316BF0C5.1FE1@condat.de> Henning Rietz <rietz@condat.de> writes:
  14. >[...]
  15. >       - "OO systems are too slow"
  16. >       - "OO systems eat up too much memory"
  17. >[...]
  18. >
  19. >What is it that would make OO slow?  [...]
  20. >
  21. >As to memory, C++ requires a bit more memory for managing the virtual
  22. >tables.  [...]
  23.  
  24. Although I have no figures or measurements, I would have to say
  25. that I suspect that the one area where C++ is slower is that
  26. there is something about C++ that encourages programmers to
  27. perform a great deal more allocation and de-allocation of 
  28. memory, causing memory fragmentation and slowing the allocation/
  29. deallocation process.  
  30.  
  31. This is partially a problem of style, using pointers and
  32. performing "new" when a non-pointer will work.  As classes
  33. are constructed of classes which are constructed...etc...
  34. a constructor call can cause numerous allocations of small
  35. bits of memory.
  36.  
  37. I know that some groups try to restrict real time software in
  38. Ada to not allocating heap space but only stack space.  I suppose
  39. you could do this in C++, too.  But, generally, that doesn't
  40. seem necessary.
  41.  
  42. -t
  43. -- 
  44. Tim Dugan
  45. mailto:timd@starbase.neosoft.com
  46. http://starbase.neosoft.com/~timd
  47.